#include "Part.h"

using namespace cmn;

int internalId = 0;

void Part::ProcessCommand( const Command& command ) {
	for( IteratorPtr<Rule> rules( &m_rules ); !rules.IsEnd(); rules.Next() ) {
		Rule rule = rules.Current();
		if( rule.Check( command ) )
			PerformAction( rule.GetAction() );
	}
}

void Part::AddRule( const Rule& rule ) {
	m_rules.Add( rule );
}

void Part::RemoveRule( const Rule& rule ) {
	m_rules.Remove( rule );
}
